package com.xintoucloud.pbs.service.impl;

import java.util.ArrayList;
import java.util.List;

import javax.transaction.Transactional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xintoucloud.pbs.dao.NewsTopicManagementDao;
import com.xintoucloud.pbs.entity.DynamicNewsTopic;
import com.xintoucloud.pbs.service.NewsTopicManagementService;

@Service
@Transactional
public class NewsTopicManagementServiceImpl implements NewsTopicManagementService {
	@Autowired
	private NewsTopicManagementDao ntmDao;
	
	@Override
	public DynamicNewsTopic getOne(int ntid) {
		DynamicNewsTopic d = ntmDao.getOne(ntid);
		return d;
	}

	@Override
	@Transactional
	public List<DynamicNewsTopic> list() {
		List<DynamicNewsTopic> list  = ntmDao.list();
		return list;
	}

	@Override
	public boolean add(DynamicNewsTopic d) {
		return (int)ntmDao.add(d)>0;
	}

	@Override
	public Boolean delete(int ntid) {
		return ntmDao.delete(ntid);
	}

	@Override
	public void update(DynamicNewsTopic d) {
		ntmDao.update(d);
		//return null;
	}


}
